//
//  ELHomeBottomView.swift
//  SinaWeiBo
//
//  Created by jiwang on 15/12/21.
//  Copyright © 2015年 jiwang. All rights reserved.
//

import UIKit

class ELHomeBottomView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        // 设置背景颜色
        backgroundColor = UIColor(white: 0.9, alpha: 1)
        
        prepareUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func prepareUI () {
        addSubview(reportButton)
        addSubview(commentButton)
        addSubview(addLikeButton)
        addSubview(sepratorLine1)
        addSubview(sepratorLine2)
        
        //水平平铺
        ff_HorizontalTile([reportButton,commentButton,addLikeButton], insets: UIEdgeInsetsZero)
        
        //设置分割线
        sepratorLine1.ff_AlignHorizontal(type: ff_AlignType.CenterRight, referView: reportButton, size: nil)
        sepratorLine2.ff_AlignHorizontal(type: ff_AlignType.CenterRight, referView: commentButton, size: nil)
    }
    
    //MARK: - 懒加载
    ///转发按钮
    private lazy var reportButton : UIButton = UIButton(imageName: "timeline_icon_retweet", title: "转发", fontSize: 11)
    
    ///评论按钮
    private lazy var commentButton : UIButton = UIButton(imageName: "timeline_icon_comment", title: "评论", fontSize: 11)
    
    ///点赞按钮
    private lazy var addLikeButton : UIButton = UIButton(imageName: "timeline_icon_unlike", title: "点赞", fontSize: 11)
    
    ///分割线1
    private lazy var sepratorLine1 : UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))
    
    ///分割线2
    private lazy var sepratorLine2 : UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))
}
